/*
	File:		Ship.h
	Course:		SGD 1301
	Author:		Peter Nguyen
	Purpose:	CShip class handles the ship entity
*/
#ifndef _SHIP_H_
#define _SHIP_H_

#include "Entity.h"
#include <Windows.h>
#include "..\SGD Wrappers\SGD_Math.h"

class CShip : public CEntity
{
public:
	void SetMaxFireRate		(float _value){m_fMaxFireRate	= _value;};
	void SetMaxAcceleration	(float _value){m_fMaxAcceleration= _value;};
	void SetMaxTurnRate		(float _value){m_fMaxTurnRate	= _value;};
	void SetMaxSpeed		(float _value){m_fMaxSpeed		= _value;};
	void SetUnstunableTimer	(float _value){m_fUnstunableTimer = _value;};
	void SetFastFireTimer	(float _value){m_fFastFireTimer	= _value;};
	void SetCameraRot		(float _value){m_fCameraRot		= _value;};
protected:
	float	m_fCameraRot	;
	float	m_fUnstunableTimer;
	float	m_fFastFireTimer;
	float	m_fFireTimer	;
	
	float	m_fMaxFireRate;
	float	m_fMaxAcceleration;
	float	m_fMaxTurnRate;
	float	m_fMaxSpeed;

	int		targetWaypointIndex;
	tVector2D targetWaypoint;

public:

	float _pervPosX;
	float _pervPosY;
	float _pervElaspedTime;

	float	GetAcceleration	( void ) const	{	return m_fMaxAcceleration	;		}
	float	GetTurnRate		( void ) const	{	return m_fMaxTurnRate		;		}
	int		GetTargetWaypoint(void)  const  {   return targetWaypointIndex	;		}

	void	SetAcceleration	( float acceleration)	{	m_fMaxAcceleration	= acceleration;	}
	void	SetTurnRate		( float turnRate	)	{	m_fMaxTurnRate		= turnRate;		}

public:
	CShip();
	~CShip();
	void virtual Update( float fElapsedTime );
	void Render( void );
	RECT virtual GetRect( void ) const;
	void virtual ApplyDraggingEffect( float fElapsedTime );
	bool CheckCollision( IEntity* pOther );

protected:
	void virtual PowerUp_Update(float fElapsedTime);
	void virtual AI_Update(float fElapsedTime);
	void Input_Update( float fElapsedTime );
	bool virtual CollideWithBound();
	void SpinOut(float fElapsedTime);
	void SelectNextWayPoint();
public:
	float spinOutTimer;
	tVector2D spinOutVector;



};


#endif